package co.id.btel.create.pdf;

import java.io.FileOutputStream;

import utilities.CellModif;
import utilities.ChunkModif;
import utilities.Constants;
import utilities.PdfUtil;

import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Chunk;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.FontFactory;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfContentByte;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;

public class PdfUsage {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		String FILE = "E:/BTE/samplePdf/Usage.pdf";
		try {
			Document document = new Document();
			PdfWriter writer = PdfWriter.getInstance(document,
					new FileOutputStream(FILE));
			ChunkModif event = new ChunkModif();
			writer.setPageEvent(event);
			document.open();
			PdfUtil.addMetaData(document);
			addInternetUsage(document);
			addVoiceUsage(document);
			addVASUsage(document);
			addOtherUsage(document);
			document.close();
			System.out.print("done!");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * @param document
	 * @throws DocumentException
	 */
	public static void addInternetUsage(Document document)
			throws DocumentException {

		PdfPTable table = new PdfPTable(3);
		table.setWidthPercentage(100);
		table.setWidths(new int[] { 19, 1, 9 });
		float chWidth;
		CellModif event;

		// colom 1
		Paragraph p = new Paragraph();
		Chunk ch = new Chunk("BIAYA INTERNET l", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_A, Font.NORMAL,
				BaseColor.WHITE));
		ch.setUnderline(Constants.AHA_BASE, 0.1f, 1, -7f, 1,
				PdfContentByte.TEXT_RENDER_MODE_STROKE);
		p.add(ch);

		ch = new Chunk(" INTERNET USAGE", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_A, Font.ITALIC,
				BaseColor.WHITE));
		ch.setUnderline(Constants.AHA_BASE, 0.1f, 1, -7f, 1,
				PdfContentByte.TEXT_RENDER_MODE_STROKE);
		p.add(ch);

		PdfPCell c1 = new PdfPCell(p);
		c1.setBorderWidth(0);
		c1.setColspan(3);
		c1.setPadding(3);
		table.addCell(c1);

		// row 1
		p = new Paragraph();
		ch = new Chunk("1. Tarif Dasar Internet AHA", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		c1.setColspan(3);
		// c1.setPadding(0);
		table.addCell(c1);

		// row 2.0
		p = new Paragraph();
		// ch = new Chunk(PdfUtil.addEmptyString("Time Based", -5),
		// FontFactory.getFont(FontFactory.HELVETICA, Constants.FONT_E,
		// Font.NORMAL, BaseColor.BLACK));
		ch = new Chunk("    Time Based ", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		// ch.setGenericTag("rect");
		chWidth = ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setBorderWidth(0);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row 2.1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);

		c1.setBorderWidth(0);
		// c1.setPadding(0);
		table.addCell(c1);

		// row 2.2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.addElement(PdfUtil.addCharge("100000"));
		CellModif cm = new CellModif("roundRect", 0);
		c1.setCellEvent(cm);
		table.addCell(c1);

		// row 3.0
		p = new Paragraph();
		ch = new Chunk("    Volume Based ", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		chWidth = ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row 3.1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);

		c1.setBorderWidth(0);
		// c1.setPadding(0);
		table.addCell(c1);

		// row 3.2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// sel 4
		p = new Paragraph();
		ch = new Chunk("2. Speed Booster ", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		chWidth = ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row 4.1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);

		c1.setBorderWidth(0);
		table.addCell(c1);

		// row 4.2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// sel 5
		p = new Paragraph();
		ch = new Chunk("3. Paket Langganan ", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row 5.1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);

		c1.setBorderWidth(0);
		// c1.setPadding(0);
		table.addCell(c1);

		// row 5.2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// sel 6
		p = new Paragraph();
		ch = new Chunk("    AHA Fantastis Pro ", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		chWidth = ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row 6.1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);

		c1.setBorderWidth(0);
		table.addCell(c1);

		// row 6.2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// sel 7
		p = new Paragraph();
		ch = new Chunk(" ", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		chWidth = ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row 7.1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);

		c1.setBorderWidth(0);
		// c1.setPadding(0);
		table.addCell(c1);

		// row 7.2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// sel 8
		p = new Paragraph();
		ch = new Chunk(" ", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		chWidth = ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row 8.1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);

		c1.setBorderWidth(0);
		// c1.setPadding(0);
		table.addCell(c1);

		// row 8.2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// sel 9
		p = new Paragraph();
		ch = new Chunk(" ", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		chWidth = ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row 9.1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);

		c1.setBorderWidth(0);
		// c1.setPadding(0);
		table.addCell(c1);

		// row 9.2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		document.add(table);

	}

	public static void addVoiceUsage(Document document)
			throws DocumentException {

		PdfPTable table = new PdfPTable(3);
		table.setWidthPercentage(100);
		table.setWidths(new int[] { 19, 1, 9 });
		float chWidth;
		CellModif event;
		CellModif cm = new CellModif("roundRect", 0);

		// colom 1
		Paragraph p = new Paragraph();
		Chunk ch = new Chunk("BIAYA TELEPON l", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_A, Font.NORMAL,
				BaseColor.WHITE));
		ch.setUnderline(Constants.AHA_BASE, 0.1f, 1, -7f, 1,
				PdfContentByte.TEXT_RENDER_MODE_STROKE);
		p.add(ch);

		ch = new Chunk(" TELEPHONE SERVICE", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_A, Font.ITALIC,
				BaseColor.WHITE));
		ch.setUnderline(Constants.AHA_BASE, 0.1f, 1, -7f, 1,
				PdfContentByte.TEXT_RENDER_MODE_STROKE);
		p.add(ch);

		PdfPCell c1 = new PdfPCell(p);
		c1.setBorderWidth(0);
		c1.setColspan(3);
		c1.setPadding(3);
		table.addCell(c1);

		// row 1
		p = new Paragraph();
		ch = new Chunk("Sesama l", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk(" On Net", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// row 2
		p = new Paragraph();
		ch = new Chunk("PSTN (Lokal/SLJJ)", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk("", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// row 3
		p = new Paragraph();
		ch = new Chunk("Mobile (Lokal/SLJJ)", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk(" On Net", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// row 4
		p = new Paragraph();
		ch = new Chunk("SLI l", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk(" IDD", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// row 5
		p = new Paragraph();
		ch = new Chunk("SMS", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk("", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		document.add(table);

	}

	public static void addVASUsage(Document document) throws DocumentException {

		PdfPTable table = new PdfPTable(3);
		table.setWidthPercentage(100);
		table.setWidths(new int[] { 19, 1, 9 });
		float chWidth;
		CellModif event;
		CellModif cm = new CellModif("roundRect", 0);

		// colom 1
		Paragraph p = new Paragraph();
		Chunk ch = new Chunk("LAYANAN TAMBAHAN l", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_A, Font.NORMAL,
				BaseColor.WHITE));
		ch.setUnderline(Constants.AHA_BASE, 0.1f, 1, -7f, 1,
				PdfContentByte.TEXT_RENDER_MODE_STROKE);
		p.add(ch);

		ch = new Chunk(" VALUE ADDED SERVICE", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_A, Font.ITALIC,
				BaseColor.WHITE));
		ch.setUnderline(Constants.AHA_BASE, 0.1f, 1, -7f, 1,
				PdfContentByte.TEXT_RENDER_MODE_STROKE);
		p.add(ch);

		PdfPCell c1 = new PdfPCell(p);
		c1.setBorderWidth(0);
		c1.setColspan(3);
		c1.setPadding(3);
		table.addCell(c1);

		// row 1
		p = new Paragraph();
		ch = new Chunk(
				"Unduh Musik l SMS Premium l Layanan Langganan l Ring Back Tone",
				FontFactory.getFont(FontFactory.HELVETICA, Constants.FONT_E,
						Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk("", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// row 2
		p = new Paragraph();
		ch = new Chunk(
				"Music Download l SMS Premium l Service Subscription l Ring Back Tone",
				FontFactory.getFont(FontFactory.HELVETICA, Constants.FONT_E,
						Font.ITALIC, BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk("", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setVerticalAlignment(Element.ALIGN_TOP);
		c1.setBorderWidth(0);
		c1.setColspan(3);
		table.addCell(c1);

		//row 2
		// row 1
		p = new Paragraph();
		ch = new Chunk(
				"Transfer Pulsa l Transfer Waktu",
				FontFactory.getFont(FontFactory.HELVETICA, Constants.FONT_E,
						Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk("", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// row 4
		p = new Paragraph();
		ch = new Chunk(
				"Balance Transfer l Active Period Transfer",
				FontFactory.getFont(FontFactory.HELVETICA, Constants.FONT_E,
						Font.ITALIC, BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk("", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setVerticalAlignment(Element.ALIGN_TOP);
		c1.setBorderWidth(0);
		c1.setColspan(3);
		table.addCell(c1);

		
		
		document.add(table);

	}

	public static void addOtherUsage(Document document)
			throws DocumentException {

		PdfPTable table = new PdfPTable(3);
		table.setWidthPercentage(100);
		table.setWidths(new int[] { 19, 1, 9 });
		float chWidth;
		CellModif event;
		CellModif cm = new CellModif("roundRect", 0);

		// colom 1
		Paragraph p = new Paragraph();
		Chunk ch = new Chunk("TAGIHAN ANDA l", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_A, Font.NORMAL,
				BaseColor.WHITE));
		ch.setUnderline(Constants.AHA_BASE, 0.1f, 1, -7f, 1,
				PdfContentByte.TEXT_RENDER_MODE_STROKE);
		p.add(ch);

		ch = new Chunk(" YOUR BILLING", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_A, Font.ITALIC,
				BaseColor.WHITE));
		ch.setUnderline(Constants.AHA_BASE, 0.1f, 1, -7f, 1,
				PdfContentByte.TEXT_RENDER_MODE_STROKE);
		p.add(ch);

		PdfPCell c1 = new PdfPCell(p);
		c1.setBorderWidth(0);
		c1.setColspan(3);
		c1.setPadding(3);
		table.addCell(c1);

		// row 1
		p = new Paragraph();
		ch = new Chunk("Cetak Tagihan l", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk(" Bill Printing", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.ITALIC,
				BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// row 2
		p = new Paragraph();
		ch = new Chunk("Diskon l", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk(" Discount", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// row 3
		p = new Paragraph();
		ch = new Chunk("PPN 10% l", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk(" VAT 10%", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// row 3
		p = new Paragraph();
		ch = new Chunk("Koreksi l", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk(" Correction", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		
		// row 4
		p = new Paragraph();
		ch = new Chunk("Biaya Materai l", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk(" Stamp Duty", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.ITALIC,
				BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// row 5
		p = new Paragraph();
		ch = new Chunk("Total Tagihan Bulan Ini l", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk(" Current Billing", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.ITALIC,
				BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		// row 6
		p = new Paragraph();
		ch = new Chunk("Dengan AHA Anda Hemat Sejumlah l", FontFactory.getFont(
				FontFactory.HELVETICA, Constants.FONT_E, Font.NORMAL,
				BaseColor.BLACK));
		p.add(ch);
		chWidth = ch.getWidthPoint();
		ch = new Chunk(" With AHA, you are saving the amount of",
				FontFactory.getFont(FontFactory.HELVETICA, Constants.FONT_E,
						Font.ITALIC, BaseColor.BLACK));
		chWidth = chWidth + ch.getWidthPoint();
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		event = new CellModif("line", chWidth,1);
		c1.setCellEvent(event);
		table.addCell(c1);

		// row .1
		p = new Paragraph();
		ch = new Chunk("Rp.", FontFactory.getFont(FontFactory.HELVETICA,
				Constants.FONT_E, Font.NORMAL, BaseColor.BLACK));
		p.add(ch);
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_LEFT);
		c1.setBorderWidth(0);
		table.addCell(c1);

		// row .2
		p = new Paragraph();
		c1 = new PdfPCell(p);
		c1.setHorizontalAlignment(Element.ALIGN_RIGHT);
		c1.setBorderWidth(0);
		c1.setCellEvent(cm);
		c1.addElement(PdfUtil.addCharge("100000"));
		table.addCell(c1);

		document.add(table);

	}

}
